package com.ler.yrmall.ware.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.ler.yrmall.basic.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 采购信息
 * @author Leron
 */
@Data
@TableName("wms_purchase")
@EqualsAndHashCode(callSuper = true)
public class PurchaseEntity extends BaseEntity<PurchaseEntity> {

    /**
     * 需求名称
     */
    private String name;

    /**
     * 采购联系人
     */
    private String linkman;

    /**
     * 联系电话
     */
    private String phone;

    /**
     * 采购状态
     * @see PurchaseStatus
     */
    private Integer status;

    /**
     * 采购状态
     */
    public enum PurchaseStatus {

        /**
         * 状态
         */
        CREATED(0,"未开始"),

        PROCESS(1,"处理中"),

        FINISH(2,"已完成"),

        PART_FAIL(3,"部分失败"),

        FAIL(4,"采购失败");

        private final Integer code;

        private final String dict;

        PurchaseStatus(Integer code, String dict) {
            this.code = code;
            this.dict = dict;
        }

        public Integer getCode() {
            return code;
        }

        public String getDict() {
            return dict;
        }

    }

}
